/**
 * Package name:indi.yangshenhui.hbase.test
 * File name:RuJiaPojo.java
 * Date:2016年4月9日-下午2:50:17
 * feiniu.com Inc.Copyright (c) 2013-2015 All Rights Reserved.
 *
 */
package indi.yangshenhui.hbase.test;

import org.apache.commons.lang.StringUtils;

import indi.yangshenhui.hbase.dao.annotation.HBaseColumn;
import indi.yangshenhui.hbase.dao.annotation.HBaseRowkey;
import indi.yangshenhui.hbase.dao.annotation.HBaseTable;

/**
 * @ClassName RuJiaPojo
 * @Description
 * @date 2016年4月9日 下午2:50:17
 * @author shenhui
 * @version 1.0.0
 *
 */
@HBaseTable(tableName = "rujia", family = "f")
public class RuJiaPojo {

	public RuJiaPojo() {
	}

	@Override
	public String toString() {
		return "RuJiaPojo [rowkey=" + rowkey + ", name=" + name + ", cardNo=" + cardNo + ", descriot=" + descriot
				+ ", ctfTp=" + ctfTp + ", ctfId=" + ctfId + ", gender=" + gender + ", birthday=" + birthday
				+ ", address=" + address + ", zip=" + zip + ", dirty=" + dirty + ", district1=" + district1
				+ ", district2=" + district2 + ", district3=" + district3 + ", district4=" + district4 + ", district5="
				+ district5 + ", district6=" + district6 + ", firstNm=" + firstNm + ", lastNm=" + lastNm + ", duty="
				+ duty + ", mobile=" + mobile + ", tel=" + tel + ", fax=" + fax + ", email=" + email + ", nation="
				+ nation + ", taste=" + taste + ", education=" + education + ", company=" + company + ", ctel=" + ctel
				+ ", caddress=" + caddress + ", czip=" + czip + ", family=" + family + ", version=" + version + ", id="
				+ id + "]";
	}

	@HBaseRowkey
	private String rowkey;

	/**
	 * rowkey
	 *
	 * @return the rowkey
	 * @since 1.0.0
	 */

	public String getRowkey() {
		return rowkey;
	}

	/**
	 * @param rowkey
	 *            the rowkey to set
	 */
	public void setRowkey(String rowkey) {
		this.rowkey = rowkey;
	}

	@HBaseColumn(column = "name")
	private String name;

	@HBaseColumn(column = "cardNo")
	private String cardNo;

	@HBaseColumn(column = "descriot")
	private String descriot;

	@HBaseColumn(column = "ctfTp")
	private String ctfTp;

	@HBaseColumn(column = "ctfId")
	private String ctfId;

	@HBaseColumn(column = "gender")
	private String gender;

	@HBaseColumn(column = "birthday")
	private String birthday;

	@HBaseColumn(column = "address")
	private String address;

	@HBaseColumn(column = "zip")
	private String zip;

	@HBaseColumn(column = "dirty")
	private String dirty;

	@HBaseColumn(column = "district1")
	private String district1;

	@HBaseColumn(column = "district2")
	private String district2;

	@HBaseColumn(column = "district3")
	private String district3;

	@HBaseColumn(column = "district4")
	private String district4;

	@HBaseColumn(column = "district5")
	private String district5;

	@HBaseColumn(column = "district6")
	private String district6;

	@HBaseColumn(column = "firstNm")
	private String firstNm;

	@HBaseColumn(column = "lastNm")
	private String lastNm;

	@HBaseColumn(column = "duty")
	private String duty;

	@HBaseColumn(column = "mobile")
	private String mobile;

	@HBaseColumn(column = "tel")
	private String tel;

	@HBaseColumn(column = "fax")
	private String fax;

	@HBaseColumn(column = "email")
	private String email;

	@HBaseColumn(column = "nation")
	private String nation;

	@HBaseColumn(column = "taste")
	private String taste;

	@HBaseColumn(column = "education")
	private String education;

	@HBaseColumn(column = "company")
	private String company;

	@HBaseColumn(column = "ctel")
	private String ctel;

	@HBaseColumn(column = "caddress")
	private String caddress;

	@HBaseColumn(column = "czip")
	private String czip;

	@HBaseColumn(column = "family")
	private String family;

	@HBaseColumn(column = "version")
	private String version;

	@HBaseColumn(column = "id")
	private String id;

	public RuJiaPojo(String[] content) {
		setName(content[0]);
		setCardNo(content[1]);
		setDescriot(content[2]);
		setCtfTp(content[3]);
		setCtfId(content[4]);
		setGender(content[5]);
		setBirthday(content[6]);
		setAddress(content[7]);
		setZip(content[8]);
		setDirty(content[9]);
		setDistrict1(content[10]);
		setDistrict2(content[11]);
		setDistrict3(content[12]);
		setDistrict4(content[13]);
		setDistrict5(content[14]);
		setDistrict6(content[15]);
		setFirstNm(content[16]);
		setLastNm(content[17]);
		setDuty(content[18]);
		setMobile(content[19]);
		setTel(content[20]);
		setFax(content[21]);
		setEmail(content[22]);
		setNation(content[23]);
		setTaste(content[24]);
		setEducation(content[25]);
		setCompany(content[26]);
		setCtel(content[27]);
		setCaddress(content[28]);
		setCzip(content[29]);
		setFamily(content[30]);
		setVersion(content[31]);
		setId(content[32]);

		setRowkey(defaultLength(getCtfId(), 18) + "_" + defaultLength(getGender(), 1) + "_" + getName());
	}

	public static String defaultLength(String s, int l) {
		if (StringUtils.isBlank(s)) {
			return createDefaultLength("0", l);
		}
		return s + createDefaultLength("0", l - s.length());
	}

	public static String createDefaultLength(String s, int l) {
		StringBuffer buffer = new StringBuffer();
		for (int i = 0; i < l; i++) {
			buffer.append(s);
		}
		return buffer.toString();
	}

	/**
	 * name
	 *
	 * @return the name
	 * @since 1.0.0
	 */

	public String getName() {
		if (StringUtils.isBlank(name)) {
			return "";
		}
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * cardNo
	 *
	 * @return the cardNo
	 * @since 1.0.0
	 */

	public String getCardNo() {
		return cardNo;
	}

	/**
	 * @param cardNo
	 *            the cardNo to set
	 */
	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	/**
	 * descriot
	 *
	 * @return the descriot
	 * @since 1.0.0
	 */

	public String getDescriot() {
		return descriot;
	}

	/**
	 * @param descriot
	 *            the descriot to set
	 */
	public void setDescriot(String descriot) {
		this.descriot = descriot;
	}

	/**
	 * ctfTp
	 *
	 * @return the ctfTp
	 * @since 1.0.0
	 */

	public String getCtfTp() {
		return ctfTp;
	}

	/**
	 * @param ctfTp
	 *            the ctfTp to set
	 */
	public void setCtfTp(String ctfTp) {
		this.ctfTp = ctfTp;
	}

	/**
	 * ctfId
	 *
	 * @return the ctfId
	 * @since 1.0.0
	 */

	public String getCtfId() {
		if (StringUtils.isBlank(ctfId)) {
			return "";
		}
		return ctfId;
	}

	/**
	 * @param ctfId
	 *            the ctfId to set
	 */
	public void setCtfId(String ctfId) {
		this.ctfId = ctfId;
	}

	/**
	 * gender
	 *
	 * @return the gender
	 * @since 1.0.0
	 */

	public String getGender() {
		if (StringUtils.isBlank(gender)) {
			return "";
		}
		return gender;
	}

	/**
	 * @param gender
	 *            the gender to set
	 */
	public void setGender(String gender) {
		this.gender = gender;
	}

	/**
	 * birthday
	 *
	 * @return the birthday
	 * @since 1.0.0
	 */

	public String getBirthday() {
		return birthday;
	}

	/**
	 * @param birthday
	 *            the birthday to set
	 */
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	/**
	 * address
	 *
	 * @return the address
	 * @since 1.0.0
	 */

	public String getAddress() {
		return address;
	}

	/**
	 * @param address
	 *            the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * zip
	 *
	 * @return the zip
	 * @since 1.0.0
	 */

	public String getZip() {
		return zip;
	}

	/**
	 * @param zip
	 *            the zip to set
	 */
	public void setZip(String zip) {
		this.zip = zip;
	}

	/**
	 * dirty
	 *
	 * @return the dirty
	 * @since 1.0.0
	 */

	public String getDirty() {
		return dirty;
	}

	/**
	 * @param dirty
	 *            the dirty to set
	 */
	public void setDirty(String dirty) {
		this.dirty = dirty;
	}

	/**
	 * district1
	 *
	 * @return the district1
	 * @since 1.0.0
	 */

	public String getDistrict1() {
		return district1;
	}

	/**
	 * @param district1
	 *            the district1 to set
	 */
	public void setDistrict1(String district1) {
		this.district1 = district1;
	}

	/**
	 * district2
	 *
	 * @return the district2
	 * @since 1.0.0
	 */

	public String getDistrict2() {
		return district2;
	}

	/**
	 * @param district2
	 *            the district2 to set
	 */
	public void setDistrict2(String district2) {
		this.district2 = district2;
	}

	/**
	 * district3
	 *
	 * @return the district3
	 * @since 1.0.0
	 */

	public String getDistrict3() {
		return district3;
	}

	/**
	 * @param district3
	 *            the district3 to set
	 */
	public void setDistrict3(String district3) {
		this.district3 = district3;
	}

	/**
	 * district4
	 *
	 * @return the district4
	 * @since 1.0.0
	 */

	public String getDistrict4() {
		return district4;
	}

	/**
	 * @param district4
	 *            the district4 to set
	 */
	public void setDistrict4(String district4) {
		this.district4 = district4;
	}

	/**
	 * district5
	 *
	 * @return the district5
	 * @since 1.0.0
	 */

	public String getDistrict5() {
		return district5;
	}

	/**
	 * @param district5
	 *            the district5 to set
	 */
	public void setDistrict5(String district5) {
		this.district5 = district5;
	}

	/**
	 * district6
	 *
	 * @return the district6
	 * @since 1.0.0
	 */

	public String getDistrict6() {
		return district6;
	}

	/**
	 * @param district6
	 *            the district6 to set
	 */
	public void setDistrict6(String district6) {
		this.district6 = district6;
	}

	/**
	 * firstNm
	 *
	 * @return the firstNm
	 * @since 1.0.0
	 */

	public String getFirstNm() {
		return firstNm;
	}

	/**
	 * @param firstNm
	 *            the firstNm to set
	 */
	public void setFirstNm(String firstNm) {
		this.firstNm = firstNm;
	}

	/**
	 * lastNm
	 *
	 * @return the lastNm
	 * @since 1.0.0
	 */

	public String getLastNm() {
		return lastNm;
	}

	/**
	 * @param lastNm
	 *            the lastNm to set
	 */
	public void setLastNm(String lastNm) {
		this.lastNm = lastNm;
	}

	/**
	 * duty
	 *
	 * @return the duty
	 * @since 1.0.0
	 */

	public String getDuty() {
		return duty;
	}

	/**
	 * @param duty
	 *            the duty to set
	 */
	public void setDuty(String duty) {
		this.duty = duty;
	}

	/**
	 * mobile
	 *
	 * @return the mobile
	 * @since 1.0.0
	 */

	public String getMobile() {
		return mobile;
	}

	/**
	 * @param mobile
	 *            the mobile to set
	 */
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	/**
	 * tel
	 *
	 * @return the tel
	 * @since 1.0.0
	 */

	public String getTel() {
		return tel;
	}

	/**
	 * @param tel
	 *            the tel to set
	 */
	public void setTel(String tel) {
		this.tel = tel;
	}

	/**
	 * fax
	 *
	 * @return the fax
	 * @since 1.0.0
	 */

	public String getFax() {
		return fax;
	}

	/**
	 * @param fax
	 *            the fax to set
	 */
	public void setFax(String fax) {
		this.fax = fax;
	}

	/**
	 * nation
	 *
	 * @return the nation
	 * @since 1.0.0
	 */

	public String getNation() {
		return nation;
	}

	/**
	 * @param nation
	 *            the nation to set
	 */
	public void setNation(String nation) {
		this.nation = nation;
	}

	/**
	 * taste
	 *
	 * @return the taste
	 * @since 1.0.0
	 */

	public String getTaste() {
		return taste;
	}

	/**
	 * @param taste
	 *            the taste to set
	 */
	public void setTaste(String taste) {
		this.taste = taste;
	}

	/**
	 * education
	 *
	 * @return the education
	 * @since 1.0.0
	 */

	public String getEducation() {
		return education;
	}

	/**
	 * @param education
	 *            the education to set
	 */
	public void setEducation(String education) {
		this.education = education;
	}

	/**
	 * company
	 *
	 * @return the company
	 * @since 1.0.0
	 */

	public String getCompany() {
		return company;
	}

	/**
	 * @param company
	 *            the company to set
	 */
	public void setCompany(String company) {
		this.company = company;
	}

	/**
	 * email
	 *
	 * @return the email
	 * @since 1.0.0
	 */

	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * ctel
	 *
	 * @return the ctel
	 * @since 1.0.0
	 */

	public String getCtel() {
		return ctel;
	}

	/**
	 * @param ctel
	 *            the ctel to set
	 */
	public void setCtel(String ctel) {
		this.ctel = ctel;
	}

	/**
	 * caddress
	 *
	 * @return the caddress
	 * @since 1.0.0
	 */

	public String getCaddress() {
		return caddress;
	}

	/**
	 * @param caddress
	 *            the caddress to set
	 */
	public void setCaddress(String caddress) {
		this.caddress = caddress;
	}

	/**
	 * czip
	 *
	 * @return the czip
	 * @since 1.0.0
	 */

	public String getCzip() {
		return czip;
	}

	/**
	 * @param czip
	 *            the czip to set
	 */
	public void setCzip(String czip) {
		this.czip = czip;
	}

	/**
	 * family
	 *
	 * @return the family
	 * @since 1.0.0
	 */

	public String getFamily() {
		return family;
	}

	/**
	 * @param family
	 *            the family to set
	 */
	public void setFamily(String family) {
		this.family = family;
	}

	/**
	 * version
	 *
	 * @return the version
	 * @since 1.0.0
	 */

	public String getVersion() {
		return version;
	}

	/**
	 * @param version
	 *            the version to set
	 */
	public void setVersion(String version) {
		this.version = version;
	}

	/**
	 * id
	 *
	 * @return the id
	 * @since 1.0.0
	 */

	public String getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

}
